import 'package:flutter/material.dart';
import 'package:fluro/fluro.dart';
import '../pages/common/login_page.dart';
import '../pages/common/register_page.dart';
import '../pages/my/my_page.dart';
import '../pages/index_page.dart';
import '../pages/my/my_order_page.dart';
import '../pages/home/serarch_page.dart';

class Routes {
  static String root = "/";
  static String login = "/login";
  static String home = '/home';
  static String register = "/register";
  static String my = "/my";
  static String myOrder = "/myOrder";
  static String searchOrder = "/searchOrder";

  static void configureRoutes(Router router) {
    router.notFoundHandler = new Handler(
        handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      print("route is not find !");
    });
    router.define(root, handler: Handler(
        handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return IndexPage();
    }), transitionType: TransitionType.cupertino);

    router.define(login, handler: Handler(
        handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return LoginPage();
    }), transitionType: TransitionType.cupertino);

    router.define(register, handler: Handler(
        handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return RegisterPage();
    }), transitionType: TransitionType.cupertino);

    router.define(myOrder, handler: Handler(
        handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return MyOrderPage();
    }), transitionType: TransitionType.cupertino);

    router.define(my, handler: Handler(
        handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return MyPage();
    }), transitionType: TransitionType.cupertino);

    router.define(searchOrder, handler: Handler(
        handlerFunc: (BuildContext context, Map<String, List<String>> params) {
      return SearchPage();
    }), transitionType: TransitionType.cupertino);
  }
}
